import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'
import IndexView from '../views/IndexView.vue'

import ProductInfo from '../views/IndexViews/ProductInfo.vue'
import UsersInfo from '../views/IndexViews/UsersInfo.vue'
import AssemblyLineInfo from '../views/IndexViews/AssemblyLineInfo.vue'
import OrderItemInfo from '../views/IndexViews/OrderItemInfo.vue'
import DefectLog from '../views/IndexViews/DefectLog.vue'
import InspectorCords from '../views/IndexViews/InspectorCords.vue'

import OrderInfo from '../views/IndexViews/OrderInfo.vue'
import OperationLog from '../views/IndexViews/OperationLog.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/index',
      name: 'index',
      component: IndexView,
      redirect:"/ProductInfo",
      children:[
        {
          path: '/ProductInfo',
          name: 'ProductInfo',
          component: ProductInfo,
        },
        {
          path: '/UsersInfo',
          name: 'UsersInfo',
          component: UsersInfo,
        },
        {
          path: '/AssemblyLineInfo',
          name: 'AssemblyLineInfo',
          component: AssemblyLineInfo,
        },
        {
          path: '/OrderInfo',
          name: 'OrderInfo',
          component: OrderInfo,
        },
        {
          path: '/OrderItemInfo',
          name: 'OrderItemInfo',
          component: OrderItemInfo,
        },
        {
          path: '/OperationLog',
          name: 'OperationLog',
          component: OperationLog,
        },
        {
          path: '/DefectLog',
          name: 'DefectLog',
          component: DefectLog,
        },
        {
          path: '/InspectorCords',
          name: 'InspectorCords',
          component: InspectorCords,
        },
        
      ]
    },
    {
      path: '/',
      name: 'LoginView',
      component: LoginView
    },
  ]
})

export default router
